package agh.tk.markuptranslation;

import java.util.ArrayDeque;
import java.util.Deque;

public abstract class AbstractWikiList extends AbstractComponent
{
	protected int level ;
	//Uzywane przy wypisywaniu w postaci HTML
	enum ListType {
		ORDERED, UNORDERED
	}
	protected static int currentListDepth = 0;
	protected static Deque<ListType> tagsToClose = new ArrayDeque<ListType>();
	public AbstractWikiList(IComponent left, IComponent right) 
	{
		super(left, right);
	}
	
	public void setLevel(int level)
	{
		this.level = level ;
	}
	
	@Override
	public String toDokuWiki() 
	{
		StringBuilder stringBuilder = new StringBuilder() ;
		stringBuilder.append('\n'); 
		for(int i = 0 ; i < level ; i++)
			stringBuilder.append("  ") ;
		return stringBuilder.toString() ;
	}
	
	@Override
	public String toMediaWiki() {
		return "\n";
	}
	
	@Override
	public String toHTML() {
		StringBuilder stringBuilder = new StringBuilder() ;
		stringBuilder.append('\n'); 
//		for(int i = 0 ; i < level-1 ; i++)
//			stringBuilder.append("  ") ;
		return stringBuilder.toString() ;
	}
	
	@Override 
	public String toTxt2tags()
	{
		StringBuilder stringBuilder = new StringBuilder() ;
		stringBuilder.append('\n'); 
		for(int i = 0 ; i < level ; i++)
			stringBuilder.append("  ") ;
		return stringBuilder.toString() ;
		
	}
}
